<template>
  <div id="app">
    <el-container>
      <el-header>
        <Navbar :active-route="activeRoute"></Navbar>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
      <Footer></Footer>
    </el-container>
  </div>
</template>

<script>
import Navbar from './components/Navbar.vue'
import Footer from './components/Footer.vue'

export default {
  name: 'App',
  components: {
    Navbar,
    Footer
  },
  computed: {
    activeRoute() {
      const path = this.$route.path
      if (path === '/') return 'home'
      if (path === '/about') return 'about'
      if (path === '/dashboard') return 'dashboard'
      return 'home'
    }
  },
  mounted() {
    console.log('App component mounted')
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  min-height: 100vh;
}

.el-header {
  background-color: #1890ff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.el-footer {
  background-color: #f0f2f5;
  padding: 20px;
  text-align: center;
}

.el-main {
  padding: 20px;
  min-height: calc(100vh - 140px);
}
</style>